﻿@model Dal.Entities.Doc2
@{
    Layout = null;
}
@if (ViewBag.DocType == 1)
{
    <table cellspacing="0" summary="table" class="broom_table" width="90%">
        <tbody>
            <tr class="odd">
                <td>
                    1
                </td>
                <td colspan="3">
                    <span>既往血糖控制水平</span>
                </td>
            </tr>
            <tr class="even">
                <td>
                    （1）
                </td>
                <td>
                    空腹血糖
                </td>
                <td>
                    @Html.TextBoxFor(i => i.BloodSugarEmpty, new { @class = "inputbox" }) mmol/L
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="odd">
                <td>
                    （2）
                </td>
                <td>
                    餐后2小时血糖
                </td>
                <td>
                    @Html.TextBoxFor(i => i.BloodSugarAfterDinner, new { @class = "inputbox" }) mmol/L
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="even">
                <td>
                    （3）
                </td>
                <td>
                    HbA1C
                </td>
                <td>
                    @Html.TextBoxFor(i => i.Hba1c, new { @class = "inputbox" }) %
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="odd">
                <td>
                </td>
                <td>
                    检测日期
                </td>
                <td>
                    <div class="rili">
                        @Html.TextBox("DetectDate", Model != null && Model.DetectDate.HasValue ? Model.DetectDate.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                    </div>
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="even">
                <td>
                    2
                </td>
                <td>
                    此次更新治疗方案的原因<br />
                    （可选择多项）
                </td>
                <td>
                    @{
    string Reason = string.Empty;
    if (Model != null && Model.Reason != null)
    {
        Reason = Model.Reason;
    }}
                    @{string item = "并发其他疾病需住院治疗 "; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "糖尿病酮症/酮症酸中毒"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "追求更佳的生活质量（如，更灵活）"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "担心体重增加"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "担心肿瘤发生风险"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "避免低血糖发生"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "其他"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "")  id="reasonother" onclick="toggle('divAddtionReasonOther')"/>
                    @item
                    <div id="divAddtionReasonOther" style="padding-left: 30px">
                        请说明 @Html.TextBoxFor(i => i.AddtionReasonOther)</div>
                    <script type="text/javascript">
                        associate('reasonother', 'divAddtionReasonOther');
                    </script>
                </td>
                <td>
                    
                </td>
            </tr>
        </tbody>
    </table>
}
else if (ViewBag.DocType == 2)
{
    <table cellspacing="0" summary="table" class="broom_table" width="90%">
        <tbody>
            <tr class="even">
                <td>
                    1
                </td>
                <td>
                    <span>既往治疗方案</span>
                </td>
                <td>
                    @{
    string cases = string.Empty;
    if (Model != null && Model.OldTreatment_2 != null)
    {
        cases = Model.OldTreatment_2;
    }
    string yds = string.Empty;
    if (Model != null && Model.AdditionCaseYDS != null)
    {
        yds = Model.AdditionCaseYDS;
    }
                    }
                    @{string item1 = "未治疗"; }
                    <input type="checkbox" name="OldTreatment_2" value="@item1" @(cases.Contains(item1) ? "checked = \"checked\"" : "") />
                    @item1
                    <br />
                    @{item1 = "饮食、运动"; }
                    <input type="checkbox" name="OldTreatment_2" value="@item1" @(cases.Contains(item1) ? "checked = \"checked\"" : "") />
                    @item1
                    <br />
                    @{item1 = "口服药物"; }
                    <input type="checkbox" name="OldTreatment_2" value="@item1" @(cases.Contains(item1) ? "checked = \"checked\"" : "") id="koufu" onclick="toggle('divkoufu')" />
                    @item1
                    <div id="divkoufu" style="padding-left: 30px">
                        <table style="border: 1px solid;">
                            <tr>
                                <td>
                                </td>
                                <td>
                                    药物名称
                                </td>
                                <td>
                                    药物剂量(mg)
                                </td>
                                <td>
                                    每日用药次数
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    1
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineName1)
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineCount1, new { style = "width:20px" })
                                </td>
                                <td>
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime1, "qd") qd
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime1, "bid") bid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime1, "tid") tid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime1, "qid") qid
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    2
                                </td>
                                <td width="10px">@Html.TextBoxFor(i => i.AdditionCaseMedicineName2)
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineCount2, new { style = "width:20px" })
                                </td>
                                <td>
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime2, "qd") qd
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime2, "bid") bid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime2, "tid") tid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime2, "qid") qid
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    3
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineName3)
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineCount3, new { style = "width:20px" })
                                </td>
                                <td>
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime3, "qd") qd
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime3, "bid") bid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime3, "tid") tid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime3, "qid") qid
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    4
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineName4)
                                </td>
                                <td>@Html.TextBoxFor(i => i.AdditionCaseMedicineCount4, new { style = "width:20px" })
                                </td>
                                <td>
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime4, "qd") qd
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime4, "bid") bid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime4, "tid") tid
                                    @Html.RadioButtonFor(i => i.AdditionCaseMedicineTime4, "qid") qid
                                </td>
                            </tr>
                        </table>
                    </div>
                    <script type="text/javascript">
                        associate('koufu', 'divkoufu');
                    </script>
                    <br />
                    @{item1 = "胰岛素"; }
                    <input type="checkbox" name="OldTreatment_2" value="@item1" @(cases.Contains(item1) ? "checked = \"checked\"" : "") id="yds" onclick="toggle('divyds')"/>
                    @item1
                    <div id="divyds" style="padding-left: 30px">
                        @{string item2 = "动物胰岛素"; }
                        <input id="AdditionCaseYDSDW" onclick="toggle('divAdditionCaseYDSDW')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divAdditionCaseYDSDW" style="padding-left: 30px">
                            早餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDW1) U<br />
                            午餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDW2) U<br />
                            晚餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDW3) U<br />
                            睡觉前 @Html.TextBoxFor(i => i.AdditionCaseYDSDW4) U
                        </div>
                        <script type="text/javascript">
                            associate('AdditionCaseYDSDW', 'divAdditionCaseYDSDW');
                        </script>
                        <br />
                        @{item2 = "短效人胰岛素"; }
                        <input id="AdditionCaseYDSDX" onclick="toggle('divAdditionCaseYDSDX')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divAdditionCaseYDSDX" style="padding-left: 30px">
                            早餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDX1) U<br />
                            午餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDX2) U<br />
                            晚餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSDX3) U
                        </div>
                        <script type="text/javascript">
                            associate('AdditionCaseYDSDX', 'divAdditionCaseYDSDX');
                        </script>
                        <br />
                        @{item2 = "NPH"; }
                        <input id="CaseAdditionCaseYDSHNP" onclick="toggle('divCaseAdditionCaseYDSHNP')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divCaseAdditionCaseYDSHNP" style="padding-left: 30px">
                            @Html.TextBoxFor(i => i.AdditionCaseYDSHNP) U
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDSHNP', 'divCaseAdditionCaseYDSHNP');
                        </script>
                        <br />
                        @{item2 = "长效胰岛素类似物"; }
                        <input id="CaseAdditionCaseYDSCX" onclick="toggle('divAdditionCaseYDSCX')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divAdditionCaseYDSCX" style="padding-left: 30px">
                            @Html.TextBoxFor(i => i.AdditionCaseYDSCX) U<br />
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDSCX', 'divAdditionCaseYDSCX');
                        </script>
                        <br />
                        @{item2 = "预混人胰岛素30"; }
                        <input id="CaseAdditionCaseYDS30" onclick="toggle('divCaseAdditionCaseYDS30')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divCaseAdditionCaseYDS30" style="padding-left: 30px">
                            早餐前 @Html.TextBoxFor(i => i.AdditionCaseYDS301) U<br />
                            晚餐前 @Html.TextBoxFor(i => i.AdditionCaseYDS302) U
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDS30', 'divCaseAdditionCaseYDS30');
                        </script>
                        <br />
                        @{item2 = "预混人胰岛素50"; }
                        <input id="CaseAdditionCaseYDS50" onclick="toggle('divCaseAdditionCaseYDS50')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divCaseAdditionCaseYDS50" style="padding-left: 30px">
                            早餐前 @Html.TextBoxFor(i => i.AdditionCaseYDS501) U<br />
                            晚餐前 @Html.TextBoxFor(i => i.AdditionCaseYDS502) U
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDS50', 'divCaseAdditionCaseYDS50');
                        </script>
                        <br />
                        @{item2 = "预混人胰岛素类似物30"; }
                        <input id="CaseAdditionCaseYDSLike30" onclick="toggle('divCaseAdditionCaseYDSLike30')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divCaseAdditionCaseYDSLike30" style="padding-left: 30px">
                            早餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSLike301) U<br />
                            午餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSLike302) U<br />
                            晚餐前 @Html.TextBoxFor(i => i.AdditionCaseYDSLike303) U
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDSLike30', 'divCaseAdditionCaseYDSLike30');
                        </script>
                        <br />
                        @{item2 = "其他"; }
                        <input id="CaseAdditionCaseYDSQiTa" onclick="toggle('divAdditionCaseYDSQiTa')" type="checkbox" name="AdditionCaseYDS" value="@item2" @(yds.Contains(item2) ? "checked = \"checked\"" : "") />
                        @item2
                        <div id="divAdditionCaseYDSQiTa" style="padding-left: 30px">
                            请说明 @Html.TextBoxFor(i => i.AdditionCaseYDSQiTa)
                        </div>
                        <script type="text/javascript">
                            associate('CaseAdditionCaseYDSQiTa', 'divAdditionCaseYDSQiTa');
                        </script>
                    </div>
                    <script type="text/javascript">
                        associate('yds', 'divyds');
                    </script>
                    <br />
                    @{item1 = "其他"; }
                    <input type="checkbox" name="OldTreatment_2" value="@item1" @(cases.Contains(item1) ? "checked = \"checked\"" : "") id="caseqita" onclick="toggle('divcaseqita')"/>
                    @item1
                    <div id="divcaseqita" style="padding-left: 30px">
                        请说明 @Html.TextBoxFor(i => i.AdditionCaseYDSQiTa)
                    </div>
                    <script type="text/javascript">
                        associate('caseqita', 'divcaseqita');
                    </script>
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="odd">
                <td>
                    2
                </td>
                <td colspan="3">
                    <span>既往血糖控制水平</span>
                </td>
            </tr>
            <tr class="even">
                <td>
                    （1）
                </td>
                <td>
                    空腹血糖
                </td>
                <td>
                    @Html.TextBoxFor(i => i.BloodSugarEmpty, new { @class = "inputbox" }) mmol/L
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="odd">
                <td>
                    （2）
                </td>
                <td>
                    餐后2小时血糖
                </td>
                <td>
                    @Html.TextBoxFor(i => i.BloodSugarAfterDinner, new { @class = "inputbox" }) mmol/L
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="even">
                <td>
                    （3）
                </td>
                <td>
                    HbA1C
                </td>
                <td>
                    @Html.TextBoxFor(i => i.Hba1c, new { @class = "inputbox" }) %
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="odd">
                <td>
                </td>
                <td>
                    检测日期
                </td>
                <td>
                    <div class="rili">
                        @Html.TextBox("DetectDate", Model != null && Model.DetectDate.HasValue ? Model.DetectDate.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                    </div>
                </td>
                <td>
                    
                </td>
            </tr>
            <tr class="even">
                <td>
                    3
                </td>
                <td>
                    此次更新治疗方案的原因<br />
                    （可选择多项）
                </td>
                <td>
                    @{
                      string Reason = string.Empty;
                      if (Model != null && Model.Reason != null)
                      {
                          Reason = Model.Reason;
                      }}
                    @{string item = "并发其他疾病需住院治疗 "; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "糖尿病酮症/酮症酸中毒"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "追求更佳的生活质量（如，更灵活）"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "担心体重增加"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "担心肿瘤发生风险"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "避免低血糖发生"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "") />
                    @item
                    <br />
                    @{item = "其他"; }
                    <input type="checkbox" name="reason" value="@item" @(Reason.Contains(item) ? "checked = \"checked\"" : "")  id="reasonother" onclick="toggle('divAddtionReasonOther')"/>
                    @item
                    <div id="divAddtionReasonOther" style="padding-left: 30px">
                        请说明 @Html.TextBoxFor(i => i.AddtionReasonOther)</div>
                    <script type="text/javascript">
                        associate('reasonother', 'divAddtionReasonOther');
                    </script>
                </td>
                <td>
                    
                </td>
            </tr>
        </tbody>
    </table>
}